//
//  ViewController.m
//  9-13
//
//  Created by 钟纪旺 on 16/9/13.
//  Copyright © 2016年 zjw. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()
@property (weak, nonatomic) IBOutlet UIButton *btn;
@property (weak, nonatomic) IBOutlet UIActivityIndicatorView *bta;
@property (weak, nonatomic) IBOutlet UISwitch *ban;
@property (weak, nonatomic) IBOutlet UISlider *slider2;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
   

}
- (IBAction)abcd:(id)sender {
    if (_bta.isAnimating) {
        [_bta stopAnimating];
    }else{
        [_bta startAnimating];
    }
}
- (IBAction)abbc:(UISwitch *)sender {
    if (sender.isOn) {
        [_bta stopAnimating];
    }else{
        [_bta startAnimating];
    }
}
- (IBAction)onchanged:(UISlider *)sender {
    
    
    _slider2.value = 1 - sender.value;
    if (0.1<sender.value <0.3) {
        self.view.backgroundColor = [UIColor cyanColor];
    }else if(0.3<sender.value<0.6)
    {
        self.view.backgroundColor = [UIColor redColor];
    }else if (0.6<sender.value<1){
    
        self.view.backgroundColor = [UIColor blueColor];
    
    }
    
}




- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
